﻿@using MyCompanyName.AbpZeroTemplate.Web.Areas.AppAreaName.Models.Maintenance
@using MyCompanyName.AbpZeroTemplate.Web.Areas.AppAreaName.Startup
@model MaintenanceViewModel
@{
    ViewBag.CurrentPageName = AppAreaNamePageNames.Host.Maintenance;
}
@section Styles {
    <link rel="stylesheet" abp-href="/view-resources/Areas/AppAreaName/Views/Maintenance/Index.css" asp-append-version="true" />
}
@section Scripts {
    <script abp-src="/view-resources/Areas/AppAreaName/Views/Maintenance/Index.js" asp-append-version="true"></script>
}

<div class="kt-subheader kt-grid__item">
    <div class="kt-subheader__main">
        <h3 class="kt-subheader__title">
            <span>@L("Maintenance")</span>
        </h3>
    </div>
</div>

<div class="kt-content">
    <div class="kt-portlet">
        <div class="kt-portlet__body">
            <div id="SettingsTabPanel" class="tabbable-line">

                <ul class="nav nav-tabs" role="tablist">
                    <li class="nav-item">
                        <a href="#CachesTab" class="nav-link active" data-toggle="tab" role="tab">
                            @L("Caches")
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="#WebSiteLogsTab" data-toggle="tab" role="tab" class="nav-link">
                            @L("WebSiteLogs")
                        </a>
                    </li>
                </ul>

                <div class="tab-content">
                    <div class="tab-content">
                        <div class="tab-pane active" id="CachesTab" role="tabpanel">
                            <div class="row margin-bottom-10">
                                <div class="col-xl-6">
                                    <p>@L("CachesHeaderInfo")</p>
                                </div>
                                <div class="col-xl-6 text-right">
                                    <button id="ClearAllCachesButton" class="btn btn-primary"><i class="fa fa-recycle"></i> @L("ClearAll")</button>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-xl-12">
                                    <table class="table table-striped table-hover table-bordered">
                                        <tbody>
                                            @foreach (var cache in Model.Caches)
                                        {
                                            <tr>
                                                <td>
                                                    <span>@cache.Name</span>
                                                    <button class="btn btn-primary btn-sm pull-right btn-clear-cache" data-cache-name="@cache.Name">
                                                        <i class="fa fa-recycle"></i> @L("Clear")
                                                    </button>
                                                </td>
                                            </tr>
                                        }
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane" id="WebSiteLogsTab" role="tabpanel">
                            <div class="row margin-bottom-10">
                                <div class="col-xl-6">
                                    <p>@L("WebSiteLogsHeaderInfo")</p>
                                </div>
                                <div class="col-xl-6 text-right">
                                    <button id="DownloadAllLogsbutton" class="btn btn-secondary"><i class="fa fa-download"></i> @L("DownloadAll")</button>
                                    <button id="RefreshButton" class="btn btn-primary"><i class="fa fa-sync"></i> @L("Refresh")</button>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-xl-12">
                                    <div id="WebSiteLogsContent" class="web-log-view full-height">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
